import Store from '../vuex';
import {async_Router} from '../router';

export function create_async_router(data){
    if(data instanceof Array){
        let arr = [];
        for(let i = 0;i<data.length;i++){
            for(let j = 0;j<async_Router.length;j++){
                if(data[i].j_name === async_Router[j].name && data[i].value === 'y'){
                    arr.push(async_Router[j]);
                }
            }
        }
        Store.commit('sidebar_add_router',arr);
    }
}